package com.matt.foundation.vo.care;

import com.matt.domain.Children;
import com.matt.domain.care.HLDailyRecord;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@Data
@EqualsAndHashCode
public class HLChildDailyRecordPageVO {

    String childId;

    private String name;

    private String nickName;

    private Integer gender;

    private String imgUrl;

    private Date birthday;

    HLDailyRecordVO record;

    public static HLChildDailyRecordPageVO of(Children c, HLDailyRecord record){
        HLChildDailyRecordPageVO ret = new HLChildDailyRecordPageVO();
        if (record != null) {
            ret.record = HLDailyRecordVO.of(record);
            ret.setChildId(record.getChildId());
            ret.setName(record.getChildName());
        }

        if (c != null) {
            ret.childId = c.getId();
            ret.setName(c.getName());
            ret.setNickName(c.getNickName());
            ret.setGender(c.getGender());
            ret.setImgUrl(c.getImgUrl());
            ret.setBirthday(c.getBirthday());
        }

        return ret;
    }

}
